﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeLinearEnt2d : OdGeCurve2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeLinearEnt2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeLinearEnt2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeLinearEnt2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeLinearEnt2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeLinearEnt2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public bool intersectWith(OdGeLinearEnt2d line, OdGePoint2d intPnt, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_intersectWith__SWIG_0(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), OdGePoint2d.getCPtr(intPnt), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt2d line, OdGePoint2d intPnt)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_intersectWith__SWIG_1(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), OdGePoint2d.getCPtr(intPnt));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool overlap(OdGeLinearEnt2d line, OdGeLinearEnt2d overlap, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_overlap__SWIG_0(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), overlap, OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool overlap(OdGeLinearEnt2d line, OdGeLinearEnt2d overlap)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_overlap__SWIG_1(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), overlap);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isParallelTo(OdGeLinearEnt2d line, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_isParallelTo__SWIG_0(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isParallelTo(OdGeLinearEnt2d line)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_isParallelTo__SWIG_1(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isPerpendicularTo(OdGeLinearEnt2d line, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_isPerpendicularTo__SWIG_0(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isPerpendicularTo(OdGeLinearEnt2d line)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_isPerpendicularTo__SWIG_1(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isColinearTo(OdGeLinearEnt2d line, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_isColinearTo__SWIG_0(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isColinearTo(OdGeLinearEnt2d line)
		{
			bool result = GlobalsPINVOKE.OdGeLinearEnt2d_isColinearTo__SWIG_1(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getPerpLine(OdGePoint2d point, OdGeLine2d perpLine)
		{
			GlobalsPINVOKE.OdGeLinearEnt2d_getPerpLine(this.swigCPtr, OdGePoint2d.getCPtr(point), OdGeLine2d.getCPtr(perpLine));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint2d pointOnLine()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeLinearEnt2d_pointOnLine(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector2d direction()
		{
			OdGeVector2d result = new OdGeVector2d(GlobalsPINVOKE.OdGeLinearEnt2d_direction(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getLine(OdGeLine2d line)
		{
			GlobalsPINVOKE.OdGeLinearEnt2d_getLine(this.swigCPtr, OdGeLine2d.getCPtr(line));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeLinearEnt2d Assign(OdGeLinearEnt2d line)
		{
			OdGeLinearEnt2d result = new OdGeLinearEnt2d(GlobalsPINVOKE.OdGeLinearEnt2d_Assign(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
